Skip to content

specdelta: -dir names a set, so the move gate has an exit that is not a derogation - #875

Merged
tannevaled merged 2 commits into
mainfrom
specdelta-dir-set
Nov 3, 2026
Merged

tannevaled merged 2 commits into
mainfrom
specdelta-dir-set

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

#874 gave cmd/specdelta a refusal for a run whose measured set does not cover
the surface a declared version move touches. The refusal was right; the exit it
advised was not reachable.

The advice could not be followed

-dir took one directory, and the refusal said "Widen -dir". For the
move this repository is actually making, the census says where the surface is:

OPENED  language/variables_spec.rb:366  >=1 examples  ruby_version_is "4.0" do
OPENED  core/binding/implicit_parameters_spec.rb:3  >=6 examples  ruby_version_is "4.0" do

3.4.1 → 4.0.9 spans core/ and language/. Every one of the 50 opened
files is under one of the two, and none is outside them — so the surface has an
exact, small description. But from -dir core the only widening available was
the whole corpus: library/, optional/, command_line/, security/, and
hours of sweep for files the move never touches.

That left -partial as the only reachable exit, which means the headline figure
for #799 would have been published stamped PARTIAL — a derogation used not
because the surface was really incomplete, but because the flag could not
express a complete one. A derogation that is the normal road is not a
derogation, and a gate whose honest exit nobody can reach is not a gate.

-dir names a set, and the refusal names the right one

$ specdelta -root ~/ruby-spec-corpus -move 3.4.1:4.0.9 -dir core ./a ./b
specdelta: the move 3.4.1 → 4.0.9 touches 1 file(s) that -dir core does not measure:
    language/variables_spec.rb
  A number from this run would not be a number about the move. Either
    -dir core,language
  which measures the whole surface, or -partial to say so on purpose —
  the report is then stamped PARTIAL.

The suggestion is computed from the census, top-level suite per uncovered file:
50 exact directories would be unreadable and would go stale the moment the
corpus moves, while core,language is both the honest surface and something a
reader can retype. It reaches core/ and language/ and not library/,
which the test asserts — a suggestion that over-reaches would re-create the
problem it is fixing.

Two ways a set can be read wrong, both tested

case why it matters
-dir core,core/set the same file reached twice would be counted twice, on both sides: the totals would then move with how the caller spelled -dir rather than with the engines
-dir core, an empty element must not be read as the root — a trailing comma would quietly sweep the whole corpus

And the control beside the refusal: retyping exactly what it advised is
accepted, exits 0, and is not stamped PARTIAL.

Refs #799

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 3, 2026 09:25
`-dir` took one directory. The move gate refuses a run whose surface reaches
outside it and advised "Widen -dir" -- advice that could not be followed, for
the move this repository is actually making:

    OPENED  language/variables_spec.rb:366 ...
    OPENED  core/binding/implicit_parameters_spec.rb:3 ...

The 3.4.1 -> 4.0.9 surface spans core/ AND language/, and the only widening
available from `core` was the whole corpus -- library/, optional/,
command_line/, security/ and hours of them. So the only reachable exit was
-partial, and every real answer about the move would have come out stamped
PARTIAL. A derogation that is the normal road is not a derogation, and a gate
whose honest exit nobody can reach is not a gate.

-dir now names a SET, comma-separated, and the refusal names the exact -dir
that would cover the surface instead of saying "widen":

    specdelta: the move 3.4.1 -> 4.0.9 touches 1 file(s) that -dir core does not measure:
        language/variables_spec.rb
      A number from this run would not be a number about the move. Either
        -dir core,language
      which measures the whole surface, or -partial to say so on purpose --
      the report is then stamped PARTIAL.

Top-level suites and no deeper: 50 exact directories would be unreadable and
would go stale with the corpus, while `core,language` is both the honest
surface and something a reader can retype. The suggestion is computed from the
census, so it reaches core/ and language/ and NOT library/.

Two things the set makes possible to get wrong, both tested:

  - a file reached through two named directories (`-dir core,core/set`) is
    measured ONCE; counted twice it is counted on both sides, and the totals
    then move with how the caller spelled -dir rather than with the engines;
  - `-dir core,` does not quietly become the whole corpus.

Refs #799

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 5e549ae into main Nov 3, 2026
26 checks passed
@tannevaled
tannevaled deleted the specdelta-dir-set branch November 3, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant